package com.wry.wry_test.model;

import com.wry.wry_test.dao.entity.Hotel;
import lombok.Data;

/**
 * @Author: wangrongyi
 * @Date: 2024/8/6 14:14
 * @Description:
 */
@Data
public class HotelDoc {
    private Long id;
    private String name;
    private String address;
    private Float price;
    private Float score;
    private String brand;
    private String city;
    private String starName;
    private String business;
    private String location;
    private String pic;

    public static HotelDoc transform(Hotel hotel) {
        HotelDoc hotelDoc = new HotelDoc();
        hotelDoc.setId(hotel.getId());
        hotelDoc.setName(hotel.getName());
        hotelDoc.setAddress(hotel.getAddress());
        hotelDoc.setPrice(hotel.getPrice());
        hotelDoc.setScore(hotel.getScore());
        hotelDoc.setBrand(hotel.getBrand());
        hotelDoc.setCity(hotel.getCity());
        hotelDoc.setStarName(hotel.getStarName());
        hotelDoc.setBusiness(hotel.getBusiness());
        hotelDoc.setLocation(hotel.getLatitude() + "," + hotel.getLongitude());
        hotelDoc.setPic(hotel.getPic());
        return hotelDoc;
    }

}
